//
//  HJNavigationBar.m
//  Sneakers
//
//  Created by 胡光健 on 2017/9/22.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "HJNavigationBar.h"

@implementation HJNavigationBar


-(void)awakeFromNib {
    [super awakeFromNib];
    self.headImage.layer.cornerRadius = 24;
    self.headImage.layer.masksToBounds = YES;
    
    self.view.layer.shadowOpacity = 0.25;
    self.view.layer.shadowRadius = 3;
    self.view.layer.shadowOffset = CGSizeZero;
    self.view.layer.shadowColor = HJColorRGB(0).CGColor;
}

-(instancetype)init{
    if (self =[super init]) {
        self = [[NSBundle mainBundle]loadNibNamed:@"HJNavigationBar" owner:nil options:nil].firstObject;
    }
    return self;
}
-(void)setModel:(HJUserModel *)model {
    _model = model;
    [self.headImage sd_setImageWithURL:HJImageUrl(model.avatar_path) placeholderImage:HJImage(@"atovor1")];
    self.userName.text = [model nickname];
    self.userPhone.text = [model mobile];
}
- (IBAction)setBtn:(UIButton *)sender {
    [[NSNotificationCenter defaultCenter] postNotificationName:@"setBtn" object:nil];
}

@end
